package com.msmall.community.album.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.msmall.base.model.BaseObject;
import com.msmall.base.util.Constants;

/**
 * 相册图片
 */
@Entity
@Table(name="base_album_photo")
public class Photo extends BaseObject{

	private static final long serialVersionUID = 1154958003433855757L;

	@Id
	@Column(name="photo_id")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long photoid;
	
	@Column(name="user_id")
	private Long userid;
	
	@Column(name="album_id")
	private Long albumid;
	
	@Column(name="title", length=15)
	private String title;
	
	@Column(name="file_path", length=50)
	private String filePath; // 文件路径

	@Column(name="file_name", length=50)
	private String fileName; //文件名称
	
	@Column(name="file_ext", length=6)
	private String fileExt; // 文件扩展名
	
	/**
	 * ConstantDB.REPLY是否允许评论
	 */
	@Column(name="reply", length=1)
	private Short reply;
	
	/**
	 * 查看次数
	 */
	@Column(name="click_amount")
	private Integer clickAmount;
	
	/**
	 * 评论次数
	 */
	@Column(name="reply_amount")
	private Integer replyAmount;
	
	/**
	 * 赞次数
	 */
	@Column(name="top_amount")
	private Integer topAmount;
	
	@Column(name="create_time")
	@Temporal(TemporalType.TIMESTAMP)
	private Date createTime;
	
	
	public String getFullPath(){
		return filePath + Constants.FILE_SEP_HTTP + fileName + "." + fileExt;
	}
	public Long getPhotoid() {
		return photoid;
	}

	public void setPhotoid(Long photoid) {
		this.photoid = photoid;
	}

	public Long getUserid() {
		return userid;
	}

	public void setUserid(Long userid) {
		this.userid = userid;
	}

	public Long getAlbumid() {
		return albumid;
	}

	public void setAlbumid(Long albumid) {
		this.albumid = albumid;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getFileExt() {
		return fileExt;
	}

	public void setFileExt(String fileExt) {
		this.fileExt = fileExt;
	}

	public Short getReply() {
		return reply;
	}

	public void setReply(Short reply) {
		this.reply = reply;
	}

	public Integer getClickAmount() {
		return clickAmount;
	}
	public void setClickAmount(Integer clickAmount) {
		this.clickAmount = clickAmount;
	}
	public Integer getReplyAmount() {
		return replyAmount;
	}
	public void setReplyAmount(Integer replyAmount) {
		this.replyAmount = replyAmount;
	}
	public Integer getTopAmount() {
		return topAmount;
	}
	public void setTopAmount(Integer topAmount) {
		this.topAmount = topAmount;
	}
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

}
